<?php
declare(strict_types=1);

namespace So;

use So\Listener\FetchModeListener;
use So\Route\DispatcherFactory;

class ConfigProvider
{
    public function __invoke(): array
    {
        return [
            'dependencies' => [
                \Hyperf\HttpServer\Router\DispatcherFactory::class => DispatcherFactory::class,
                \Hyperf\HttpServer\Server::class => Server::class
            ],
            'annotations' => [
                'collectors' => [
                    \So\Annotation\Model::class,
                ],
                'scan' => [
                    'paths' => [
                        __DIR__,
                    ],
                ],
            ],
            'commands' => [],
            'listeners' => [
                FetchModeListener::class
            ],
            'publish' => [
                [
                    'id' => 'config',
                    'description' => 'The config for phpben/so-admin.',
                    'source' => __DIR__ . '/../publish/so.php',
                    'destination' => BASE_PATH . '/config/autoload/so.php',
                ],
            ],
        ];
    }
}